#include <ros/ros.h>
 // #include "MyVisionNode.h"
#include <string>
#include <sensor_msgs/Image.h>

//dimensions 240x320
void webCamCallBack(const sensor_msgs::ImageConstPtr& image_msg)
{
 	// ROS_INFO("MyVisionNode::imageCb Print");

	sensor_msgs::Image current_rgb_msg;
  current_rgb_msg = *image_msg;

  // ROS_ERROR("webCamCallBack Print  %d",current_rgb_msg.data[100]);
  ROS_ERROR("webCamCallBack height  %d",current_rgb_msg.height);
 	ROS_ERROR("webCamCallBack width  %d",current_rgb_msg.width);
}

//dimensions 480x640
// bgr
void kinectCallBack(const sensor_msgs::ImageConstPtr& image_msg)
{
  // ROS_INFO("MyVisionNode::imageCb Print");

  sensor_msgs::Image current_rgb_msg;
  current_rgb_msg = *image_msg;





  ROS_INFO("kinectCallBack height 0  %d",current_rgb_msg.data[0]);
  ROS_INFO("kinectCallBack height 1  %d",current_rgb_msg.data[1]);
  ROS_INFO("kinectCallBack height 2  %d\n",current_rgb_msg.data[2]);



  ROS_INFO("kinectCallBack height 3  %d",current_rgb_msg.data[3]);
  ROS_INFO("kinectCallBack height 4  %d",current_rgb_msg.data[4]);
  ROS_INFO("kinectCallBack height 5  %d\n",current_rgb_msg.data[5]);

  // ROS_INFO("kinectCallBack Print  %d",current_rgb_msg.data[100]);
}



int main(int argc, char **argv) {

	// initialize system
	ros::init(argc, argv, "webCamTest");
	ros::NodeHandle node_handler;
  ros::Rate loop_rate(1);

  ros::Subscriber kinect_subscriber = node_handler.subscribe("/camera/rgb/image_color",10, kinectCallBack);
  // ros::Subscriber webcam_subscriber = node_handler.subscribe("/image_raw",10, webCamCallBack);


    while(ros::ok())
    {
      ros::spinOnce();
    }

  return 0;
}





